<?php
function GlobalMemoryStatus()
{
	$kernel = w32_load_lib("kernel32.dll");
	$fgms = w32_get_func_addr($kernel,"GlobalMemoryStatus");
	$val = pack('V8', 8*4, 0,0,0,0,0,0,0);
	w32_call_func($fgms, array(&$val), 0);
	return unpack("Vlen/Vmemload/Vphys/Vavailphys/Vpagefile/Vavailpagefile/Vvirtual/Vavailvirtual",$val);
}
 
$mem = GlobalMemoryStatus();
$report =  "Total RAM is " . sprintf("%.2f", ($mem["phys"] / (1024 * 1024))) . " MB, " . $mem["memload"] . "% used";
echo $report;
if(php_sapi_name()=='cli')system("pause");
?>